/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package app.gui.scene;

import java.util.ArrayList;
import javafx.scene.Scene;

/**
 *
 * @author sammael
 */
public abstract class SceneHolder implements SceneSubject{
    protected Scene scene;
    protected Scene nextScene;
    protected SceneHolder previousHolder;
    protected static final int buttonWidth = 150;
    protected static final int rootWidth = 1200;
    protected static final int rootHeigh = 550;
    protected static final int spacing = 30;
    protected ArrayList<SceneObserver> observers = new ArrayList<>();
    
    public Scene getScene(){
        return scene;
    }
    public void setPreviousSceneHolder(SceneHolder holder){
        previousHolder = holder;   
    }
    
    @Override
    public void registerObserver(SceneObserver observer) {
        observers.add(observer);
    }

    @Override
    public void removeObserver(SceneObserver observer) {
        observers.remove(observer);
    }

    @Override
    public void notifyObservers() {
        for(SceneObserver ob : observers){
            ob.updateScene(nextScene);
        }
    }
}
